package com.wx.servlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

@WebServlet(urlPatterns = "*.action", loadOnStartup = 2)
public class ContextPathInitServlet extends HttpServlet {

	private static final long serialVersionUID = 7859;

	@Override
	public void init(ServletConfig config) throws ServletException {
		String contextPath = config.getServletContext().getContextPath();
		config.getServletContext().setAttribute("ctx", contextPath);
		System.out.println(contextPath);
	}
}
